# to standard output. If FILTER_PATTERNS is specified, this tag will be
# ignored.
-INPUT_FILTER = "sh ./Doxyfilter"
+INPUT_FILTER = "sh ./Doxyfilter ../tools/python"
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
sys.stdout.write(s)\r
\r
def filter(filename):\r
- global name, module_has_docstring\r
+ global name, module_has_docstring, source_root\r
\r
path,name = os.path.split(filename)\r
root,ext = os.path.splitext(name)\r
\r
- output("namespace "+root+" {\n",(0,0))\r
+ if source_root and path.find(source_root) == 0:\r
+ path = path[len(source_root):]\r
+\r
+ if path[0] == os.sep:\r
+ path = path[1:]\r
+\r
+ ns = path.split(os.sep)\r
+ else:\r
+ ns = []\r
+\r
+ ns.append(root)\r
+\r
+ for n in ns:\r
+ output("namespace " + n + " {\n",(0,0))\r
\r
# set module name for tok_eater to use if there's a module doc string\r
name = root\r
print_comment((0,0))\r
\r
output("\n",(0,0))\r
- output("} // end of namespace\n",(0,0))\r
+ \r
+ for n in ns:\r
+ output("} // end of namespace\n",(0,0))\r
\r
if not module_has_docstring:\r
# Put in default namespace documentation\r
######################################################################\r
\r
filter_file = False\r
+source_root = None\r
\r
try:\r
- opts, args = getopt.getopt(sys.argv[1:], "hf", ["help"])\r
+ opts, args = getopt.getopt(sys.argv[1:], "hfr:", ["help"])\r
except getopt.GetoptError,e:\r
print e\r
sys.exit(1)\r
if o=="-f":\r
filter_file = True\r
\r
+ if o=="-r":\r
+ source_root = os.path.abspath(a)\r
+\r
if filter_file:\r
# Filter the specified file and print the result to stdout\r
filename = string.join(args)\r
- filterFile(filename)\r
+ filterFile(os.path.abspath(filename))\r
else:\r
\r
if len(args)!=2:\r